<?php
namespace app\common\model;
use app\common\model\BaseModel;
class Admin extends BaseModel{
    protected $autoWriteTimestamp=true;
     //重写
     public function add($data){
        $data["status"]=1;
        $data["last_login_time"]=time();
        $this->save($data);
        return $this->aid;
      }
   
    public function updateById($data,$id){
        //allowField();
    return $this->allowField(true)->save($data,["aid"=>$id]);
        
    }
    //管理员信息
    
    public function getNormalAdmin(){
        $data["status"]=1;
        $order=[
            'aid'=>'desc',
        ];
        
        $result=$this->where($data)
                   ->order($order)
                   ->select();
        
        return $result;
    }
    
    
}

